package com.ruoyi.system.utils;

import java.util.ArrayList;
import java.util.List;

//转换
public class ReplaceUtil {

    //去除[]
    public static String replaceZKH(String s) {
        return s.replaceAll("\\[", "").replaceAll("\\]", "")
                .replaceAll(" ", "")
                .replaceAll("null", "");
    }

    //字符串转数组(Long)
    public static List<Long> strToList(String s){
        List<Long> list = new ArrayList<>();
        if (s != null){
            String[] strings = s.split(",");
            for (String string : strings) {
                list.add(Long.parseLong(string));
            }
            return list;
        }
        return null;
    }
}
